package com.example.demo.controller;

import com.example.demo.service.HelloService;
import mode.helloview;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class HelloDemoView {

    private final HelloService helloService;


    public HelloDemoView(HelloService helloService) {
        this.helloService = helloService;
    }

    @RequestMapping("/ResultHt.html")
    public String getArticleList(Model model) {



        List<helloview> list = helloService.selectAll();
        model.addAttribute("list", list);

        System.out.println("========getArticleList====>"+list.toString());
        return "ResultHt";
    }

    @RequestMapping("/command.html")
    public String postCommand(){
        return "CommandCommit";
    }
    @RequestMapping("/index_new.html")
    public String postClearCommand(){
        return "index_new";
    }

    @RequestMapping("/")
    public String postIndex(){
        return "index";
    }
}
